#include <cjsonvaluestring.h>

CJsonValueString::CJsonValueString(jstring value) :
  CJsonValue(JV_STRING)
{
  this->value = value;
}

jstring CJsonValueString::ToString()
{
  return J("\"") + value + J("\"");
}

//size_t CJsonValueString::GetBufferSize() const
//{
//  return value.size();
//}

/*void CJsonValueString::ToBuffer(char * buffer, size_t buffer_size)
{
  if (!buffer || !*buffer || buffer_size < value.size() + 1)
  {
    //error
  }
  for (size_t i = 0; i < buffer_size; i++, buffer++)
  {
    *buffer = value[i];
  }
}*/

void CJsonValueString::GetValue(jstring & str) const
{
  str = value;
}

